
public class TestClass {

    public static void main(String[] args){
        String str1 = "1101";
        String str2 = "10001";

        int len1 = str1.length();
        int len2 = str2.length();
        int longLen;
        String longer ,shorter;
        if(len1<len2){
            longer = str2;
            shorter = str1;
            longLen = len2;
        }else {
            longer = str1;
            shorter = str2;
            longLen = len1;
        }
        int[] temp = new int[longLen+1];
        int[] data= new int[longLen];
        int[] flag = new int[longLen+1];
        char[] longc = longer.toCharArray();
        char[] shortc = shorter.toCharArray();

        for (int i = 0; i < longLen ; i++) {
            int a,b=0;
            a = longc[longLen-1-i]-48;
            if(i<=(shortc.length-1)) {
                b = shortc[shortc.length-1-i]-48;
            }
            temp[i] = a+b+flag[i];
            if(temp[i] == 2){
                flag[i+1] = 1;
                data[i] = 0;
            }else if (temp[i] == 3){
                flag[i+1] = 1;
                data[i]= 1;
            }else{
                data[i] = temp[i];
            }

        }
        StringBuilder stringBuilder = new StringBuilder();

        if(flag[longLen] == 1){
            stringBuilder.append(1);
            System.out.println("最大进位");
        }
        for (int i = 0; i < data.length; i++) {
            stringBuilder.append(data[data.length-1-i]);
        }
        System.out.println(stringBuilder.toString());

    }

//    drop table if exists order_info;
//    CREATE TABLE order_info (
//            id int(4) NOT NULL,
//    user_id int(11) NOT NULL,
//    product_name varchar(256) NOT NULL,
//    status varchar(32) NOT NULL,
//    client_id int(4) NOT NULL,
//    date date NOT NULL,
//    PRIMARY KEY (id));
//
//    INSERT INTO order_info VALUES
//            (1,557336,'C++','no_completed',1,'2025-10-10'),
//(2,230173543,'Python','completed',2,'2025-10-12'),
//        (3,57,'JS','completed',3,'2025-10-23'),
//        (4,57,'C++','completed',3,'2025-10-23'),
//        (5,557336,'Java','completed',1,'2025-10-23'),
//        (6,57,'Java','completed',1,'2025-10-24'),
//        (7,557336,'C++','completed',1,'2025-10-25'),
//        (8,557336,'Python','completed',1,'2025-10-26');

    //查询
}

